import type { AreaListData, AreaListParams, AreaParams } from "@/types/area"
import { request } from "@/utils/reuqest"


/**
 * 获取区域列表
 * @param params 
 * @returns 
 */
export const getAreaListAPI = (params: AreaListParams) => {
  return  request<AreaListData>('/parking/area/list', 'GET', params)
}

/**
 * 创建区域
 * @param data 
 * @returns 
 */
export const createAreaAPI = (data: AreaParams) => {
  return request('/parking/area', 'POST', data)
}

/**
 * 更新区域
 * @param data 
 * @returns 
 */
  export const updateAreaAPI = (data: AreaParams) => {
    return request('/parking/area', 'PUT', data)
  }

/**
 * 删除区域
 * @param id 
 * @returns 
 */

export const delAreaAPI = (id: number) => {
  return request(`/parking/area/${id}`, 'DELETE')
}